<html>
  <head>
    <script src="qrc:///qtwebchannel/qwebchannel.js"></script>
    <script src="qrc:/share/js/jquery-3.6.0.min.js"></script>

    <!--
    <link rel="stylesheet" type="text/css"
      href="qrc:///theme/css/search.css"></script>
    -->

    <style>
      {% include "assets/css/ipfs-search.css" %}
    </style>

    <script type="text/javascript">
      {% include "assets/js/ipfs-search-ui.js" %}
    </script>
  </head>
  <body>

{% if searchMode == 'classic' %}
    <div width="100%" class="container" id="searchcontrols">
      <div style="float: left; width='90%'">
        <form id="searchform" onsubmit="event.preventDefault(); window.runSearch();">
          <input type="text" class="waitinput" name="query" id="searchquery" />
          <select style="max-width: 100px" id="contenttype">
            <option value="*">All</option>
            <option value="images">Images</option>
            <option value="audio">Audio</option>
            <option value="videos">Videos</option>
            <option value="text">Text</option>
            <option value="webpages">Web pages</option>
            <option value="pdf">PDF documents</option>
          </select>

          <select id="mimetype_selector">
          </select>

          <select id="last-seen-period">
          </select>

          <input type="submit" name="searchbtn" value="Search" width="300"/>
        </form>
      </div>

      <div style="float: right; width='20%'">
        <p>
        IPFS Gateway
        </p>
        <select name="gateway" id="gateway_selector" form="searchform">
        </select>
      </div>
    </div>

{% elif searchMode == 'nocontrols' %}
<form onsubmit="event.preventDefault()">
<input type="text" class="waitinput" name="query"
    id="searchquery" width="400" disabled/>
</form>
{% endif %}

    <br style="clear: left;"/>

    <div>
      <p id="statusmessage"/>
    </div>

    <div width="100%" id="controls"
        style="margin-left: 100px; display: none">
      <a class="pagecontrol" style="margin-right: 10px" href="#"
        id="pageprev" onclick="window.previousPage();">Previous page</a>
      <span id="pageinfo"></span>
      <a class="pagecontrol" style="margin-left: 10px" href="#"
        id="pagenext" onclick="window.nextPage();">Next page</a>
    </div>

    <div id="results">
    </div>

    <div width="100%" id="controls_b" style="margin-left: 100px; display: none">
      <a class="pagecontrol" style="margin-right: 10px" href="#"
        id="pageprev_b" onclick="window.previousPage();">Previous page</a>
      <a class="pagecontrol" style="margin-left: 10px" href="#"
        id="pagenext_b" onclick="window.nextPage();">Next page</a>
    </div>
  </body>
</html>
